package com.rhb.ca.role.web.struts.form;

import java.util.Set;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;

import com.rhb.ca.role.bean.Role;
import com.rhb.ca.role.bean.RoleQuery;
import com.rhb.ca.web.struts.form.ListForm;

public class RoleForm extends ListForm {

	// Fields
	private Role role;
	private RoleQuery roleQuery;
	private Set uzers;
	
	public Set getUzers() {
		return this.getRole().getUzers();
	}

	public void setUzers(Set uzers) {
		this.uzers = uzers;
	}

	// default construct
	public RoleForm() {
		role = new Role();
		roleQuery = new RoleQuery();
		uzers = role.getUzers();
	}
	
	// get, set
	public Role getRole() {
		return role;
	}

	public void setRole(Role role) {
		this.role = role;
	}

	public RoleQuery getRoleQuery() {
		return roleQuery;
	}

	public void setRoleQuery(RoleQuery roleQuery) {
		this.roleQuery = roleQuery;
	}

	// validate
	public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {

		ActionErrors errors = new ActionErrors();

		if ("add".equalsIgnoreCase(this.getBehavior()) || "edit".equalsIgnoreCase(this.getBehavior())) {
																																	}

		return errors;
	}
}
